package cn.wolfcode.web.controller;

import cn.wolfcode.domain.Business;
import cn.wolfcode.domain.SystemDictionary;
import cn.wolfcode.service.IBusinessService;
import cn.wolfcode.service.ISystemDictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class IndexController {

    @Autowired
    private IBusinessService businessService;

    @Autowired
    private ISystemDictionaryService systemDictionaryService;

    @RequestMapping("/index")
    public String index(Model model) {

        //查询总店
        Business business = businessService.queryMainStore();
        model.addAttribute("main", business);

        List<SystemDictionary> buss = systemDictionaryService.queryBySn("business");
        model.addAttribute("buss", buss);

        return "index";
    }


}
